<template>
	<div>
		<!--<s-nav ></s-nav>-->
		<div class="line"></div>
		<mnav></mnav>
		<second-nav :tid="Parent_tid" ></second-nav>
		<!--<span @click="add" >{{getCount}}</span>-->
		
		
	</div>
</template>

<script>
//	import sNav from 'base/sNav/sNav'
	import mnav from 'components/nav/nav';
	import secondNav from 'components/secondNav/secondNav'
	import {mapState} from 'vuex'
	export default {
		name:"channel",
		components:{
			mnav,
			secondNav
		},
		data(){
			return {
				Parent_tid:this.$route.params.tid
			}
		},
		created(){
		
		},
		props:{
	
		},
		mounted(){
			this._SetTid()
		},
		computed:{
//			count(){
//				return this.$store.state.count
//			},
			getCount(){
				return this.$store.getters.getCount
			},
			Navtid(){
				return this.$store.state.Navtid
			}
	},
		watch:{
			$route:function(newValue,oldValue){
				if(newValue.path.indexOf("channel")){
					//实时更新vuex中state里面curtid
					this.$store.commit("setCurTid",{
						curTid:newValue.params.tid
					})
					this.Parent_tid=newValue.params.tid
				}
			}
		},
		methods:{
			changeTid(tid){
//				tid来自于子组件的
				this.Parent_tid=tid;
			},
			add(){
//				触发store里面的mutation中定义的方法
				this.$store.commit('increment')
			},
			_SetTid(){
				console.log(this.$route)
			},
		}
	}
</script>

<style>
</style>